﻿package  {
	
	import flash.display.MovieClip;
	import flash.events.Event;
	
	
	public class Whip extends MovieClip {
		
		private var duration;
		
		public function Whip() {
			// constructor code
			duration = 10;
			addEventListener(Event.ENTER_FRAME, vanish);
		}
		
		private function vanish(e:Event)
		{
			if(this.stage)
			{
				duration--;
			}
			
			if (duration <= 0)
			{
				parent.removeChild(this)
				duration = 10;
			}
		}
		
		
	}
	
}
